﻿<%@ Page Title="Cungmuanao.com - Quản Lý thông tin trang chủ" Language="C#" MasterPageFile="~/Admin/Admin.master" ValidateRequest="false" AutoEventWireup="true" CodeFile="ManageBanner2.aspx.cs" Inherits="ManageBanner2" %>
<%@ Import Namespace="DTO" %>
<%@ Register src="../Controls/FileUpload.ascx" tagname="FileUpload" tagprefix="uc1" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="LeftContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <p></p>  
    <table width="100%" cellpadding="5" cellspacing="5">
        <tr>
            <td colspan="2">
                <p>
                    <asp:Label runat="server" ID="lblHuongdan" Text="Chỉ sử dụng những hình có chiều rộng nhỏ hơn 100px, chiều dài thì bao nhiêu tùy thích." ForeColor="Red"></asp:Label>
                </p>            
            </td>
        </tr>
        <tr>
            <td style="width:50%;" align="left">
                <div style="width:300px; text-align:left; height:30px; float:left;">Banner bên trái</div>
                <asp:DetailsView runat="server" ID="DetailsView_Banner1" DefaultMode="Edit"
                    AutoGenerateRows="False" DataKeyNames="ID" Width="100%" BorderStyle="None"
                DataSourceID="objBanner1" >
                <FieldHeaderStyle Width="120px" />
                <Fields>                   
                    <asp:TemplateField HeaderText="Hình">
                        <ItemTemplate>
                            <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Abstract") %>' />
                        </ItemTemplate>
                    </asp:TemplateField> 
                     <asp:TemplateField HeaderText="Image / Flash">
                        <%--<ItemTemplate>
                           <asp:CheckBox ID="chkApproved" runat="server" Checked='<%# Eval("Approved") %>' Enabled="False" />
                        </ItemTemplate>--%>
                        <EditItemTemplate>
                           <%--<asp:CheckBox ID="chkApproved" runat="server" Checked='<%# Bind("Approved") %>' />--%>
                            <asp:CheckBoxList ID="cblChoose" runat="server">
                                <asp:ListItem Text="Image" Value="1"/>
                                <asp:ListItem Text="Flash" Value="2"/>
                            </asp:CheckBoxList>
                        </EditItemTemplate>
                     </asp:TemplateField>
                    <asp:TemplateField HeaderText="Link website" >
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtBody" Text='<%#Bind("Body") %>' Width="99%" />
                        </EditItemTemplate>
                    </asp:TemplateField>                                
                    <asp:TemplateField HeaderText="Link banner" >
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtImage" Text='<%#Bind("Abstract") %>' Width="99%" />
                        </EditItemTemplate>
                    </asp:TemplateField>
                      <asp:CommandField ButtonType="Image" ShowCancelButton="false" 
                            ShowEditButton="True" UpdateImageUrl="~/Images/capnhat.png" 
                          UpdateText="Cập nhật" />        
                </Fields>
                </asp:DetailsView>
    
                <asp:ObjectDataSource runat="server" ID="objBanner1" TypeName="BLL.Pages.Pages" SelectMethod="GetPage" 
                UpdateMethod="UpdatePage">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="9" Name="PageID" Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="id" Type="Int32" DefaultValue="9" />
                        <asp:Parameter Name="title" Type="String" ConvertEmptyStringToNull="false"/>
                        <asp:Parameter Name="importance" Type="Int32" />
                        <asp:Parameter Name="Abstract" Type="String" ConvertEmptyStringToNull="false" />
                        <asp:Parameter Name="body" Type="String" ConvertEmptyStringToNull="false" />
                    </UpdateParameters>
                </asp:ObjectDataSource>
                <uc1:FileUpload ID="FileUpload1" runat="server" />            
            </td>
            <td style="width:50%" align="right">
                <div style="width:300px; text-align:left; height:30px; float:left;">Banner bên phải</div>
                <asp:DetailsView runat="server" ID="DetailsView_Banner2" DefaultMode="Edit"
                    AutoGenerateRows="False" DataKeyNames="ID" Width="100%" BorderStyle="None"
                DataSourceID="objBanner2" >
                <FieldHeaderStyle Width="120px" />
                <Fields>                   
                    <asp:TemplateField HeaderText="Hình">
                        <ItemTemplate>
                            <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Abstract") %>' />
                        </ItemTemplate>
                    </asp:TemplateField> 
                    <asp:TemplateField HeaderText="Link website" >
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtBody" Text='<%#Bind("Body") %>' Width="99%" />
                        </EditItemTemplate>
                    </asp:TemplateField>                                
                    <asp:TemplateField HeaderText="Link banner" >
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtImage" Text='<%#Bind("Abstract") %>' Width="99%" />
                        </EditItemTemplate>
                    </asp:TemplateField>
                      <asp:CommandField ButtonType="Image" ShowCancelButton="false" 
                            ShowEditButton="True" UpdateImageUrl="~/Images/capnhat.png" 
                          UpdateText="Cập nhật" />        
                </Fields>
                </asp:DetailsView>
    
                <asp:ObjectDataSource runat="server" ID="objBanner2" TypeName="BLL.Pages.Pages" SelectMethod="GetPage" 
                UpdateMethod="UpdatePage">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="10" Name="PageID" Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="id" Type="Int32" DefaultValue="10" />
                        <asp:Parameter Name="title" Type="String" ConvertEmptyStringToNull="false"/>
                        <asp:Parameter Name="importance" Type="Int32" />
                        <asp:Parameter Name="Abstract" Type="String" ConvertEmptyStringToNull="false" />
                        <asp:Parameter Name="body" Type="String" ConvertEmptyStringToNull="false" />
                    </UpdateParameters>
                </asp:ObjectDataSource>
                <uc1:FileUpload ID="FileUpload2" runat="server" />            
            </td>
        </tr>
        <tr>
            <td colspan=2>
                <asp:DetailsView runat="server" ID="DetailsView1" DefaultMode="Edit"
                    AutoGenerateRows="False" DataKeyNames="ID" Width="100%" BorderStyle="None"
                DataSourceID="ObjectDataSource1" >
                <FieldHeaderStyle Width="120px" />
                <Fields>                   
                    <asp:TemplateField HeaderText="Hình">
                        <ItemTemplate>
                            <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Abstract") %>' />
                        </ItemTemplate>
                    </asp:TemplateField> 
                    <asp:TemplateField HeaderText="Link website" >
                        <EditItemTemplate>
                            <%--<asp:TextBox runat="server" ID="txtBody" Text='<%#Bind("Body") %>' Width="99%" />--%>
                            <fckeditorv2:fckeditor id="txtBody" runat="server" Value='<%# Bind("Body") %>'
                                              ToolbarSet="Default" Height="400px" Width="100%" />
                        </EditItemTemplate>
                    </asp:TemplateField>                                
                    <asp:TemplateField HeaderText="Link banner" >
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtImage" Text='<%#Bind("Abstract") %>' Width="99%" />
                        </EditItemTemplate>
                    </asp:TemplateField>
                      <asp:CommandField ButtonType="Image" ShowCancelButton="false" 
                            ShowEditButton="True" UpdateImageUrl="~/Images/capnhat.png" 
                          UpdateText="Cập nhật" />        
                </Fields>
                </asp:DetailsView>
    
                <asp:ObjectDataSource runat="server" ID="ObjectDataSource1" TypeName="BLL.Pages.Pages" SelectMethod="GetPage" 
                UpdateMethod="UpdatePage">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="9" Name="PageID" Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="id" Type="Int32" DefaultValue="9" />
                        <asp:Parameter Name="title" Type="String" ConvertEmptyStringToNull="false"/>
                        <asp:Parameter Name="importance" Type="Int32" />
                        <asp:Parameter Name="Abstract" Type="String" ConvertEmptyStringToNull="false" />
                        <asp:Parameter Name="body" Type="String" ConvertEmptyStringToNull="false" />
                    </UpdateParameters>
                </asp:ObjectDataSource>            
            </td>
        </tr>
    </table>  
    <p></p> 
</asp:Content>

